﻿using System;
using System.Windows;
using System.Xml.Linq;

namespace G19Glower.Shared
{
    /// <summary>
    /// Provides contract for a single settings controller.
    /// </summary>
    public interface ISettings
    {
        event EventHandler SettingsUIValueChanged;

        /// <summary>
        ///  Sets up the settings by providing storage xml element.
        /// </summary>
        /// <param name="settingsElement">Element to retrieve & store settings in.</param>
        void Initialize(XElement settingsElement);

        /// <summary>
        /// Called when settings are to be put into effect. Typically from editing <see cref="SettingsUI"/>.
        /// </summary>
        void ApplySettings();

        /// <summary>
        /// Gets the title of this settings collection
        /// </summary>
        string SettingsTitle { get; }

        /// <summary>
        /// UI to edit this collection of settings.
        /// </summary>
        FrameworkElement SettingsUI { get; }
    }
}
